package com.zhentao.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.boot.convert.PeriodFormat;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 财务主表
 * @TableName yd_account_head
 */
@TableName(value ="yd_account_head")
@Data
public class YdAccountHead implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 类型(支出/收入/收款/付款/转账)
     */
    @TableField(value = "type")
    private String type;

    /**
     * 单位Id(收款/付款单位)
     */
    @TableField(value = "organ_id")
    private Long organId;

    /**
     * 经手人id
     */
    @TableField(value = "hands_person_id")
    private Long handsPersonId;

    /**
     * 操作员
     */
    @TableField(value = "creator")
    private Long creator;

    /**
     * 变动金额(优惠/收款/付款/实付)
     */
    @TableField(value = "change_amount")
    private BigDecimal changeAmount;

    /**
     * 优惠金额
     */
    @TableField(value = "discount_money")
    private BigDecimal discountMoney;

    /**
     * 合计金额
     */
    @TableField(value = "total_price")
    private BigDecimal totalPrice;

    /**
     * 账户(收款/付款)
     */
    @TableField(value = "account_id")
    private Long accountId;

    /**
     * 单据编号
     */
    @TableField(value = "bill_no")
    private String billNo;

    /**
     * 单据日期
     */
    @TableField(value = "bill_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date billTime;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 附件名称
     */
    @TableField(value = "file_name")
    private String fileName;

    /**
     * 状态，0未审核、1已审核、9审核中
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 租户id
     */
    @TableField(value = "tenant_id")
    private Long tenantId;

    /**
     * 删除标记，0未删除，1删除
     */
    @TableField(value = "delete_flag")
    @TableLogic(delval = "1", value = "0")
    private Integer deleteFlag;
    //开始时间
    @TableField(exist = false)
    private String startTime;
    //结束时间
    @TableField(exist = false)
    private String endTime;
    //    用户名
    @TableField(exist = false)
    private String username;
    //    收入账户
    @TableField(exist = false)
    private String accountName;
    //    财务人员
    @TableField(exist = false)
    private String handsPersonName;
    //    往来单位
    @TableField(exist = false)
    private String orgAbr;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}